﻿<%@ Page Title="" Language="C#" MasterPageFile="~/share/Site1.Master" AutoEventWireup="true"
    CodeBehind="Register.aspx.cs" Inherits="RGPWEB.Register" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script src="inc/Script/pub.js" type="text/javascript"></script>

    <script src="inc/Script/PwdCheck.js" type="text/javascript"></script>

    <script type="text/javascript">
        function CheckReg() {
            var ret = true;
            var str = "";
            $id("strinfo").innerHTML = "";

            ErrorStr = new Array(); //错误消息

            if (!IsEmpty($id("txt_name").value)) {
                ErrorStr.push("用户名不能为空,请输入用户名!");
            }
            else if (!CheckName($id("txt_name").value)) {
                ErrorStr.push("请输入合法用户名,用户名必须为字母、数字、下划线组合!");
            }

            if (!IsEmpty($id("txt_password").value)) {
                ErrorStr.push("密码不能为空,请输入密码!");
            }
            else if (!IsEmpty($id("txt_repassword").value)) {
                ErrorStr.push("验证密码不能为空,请输入验证密码!");
            }
            else if (!CompValue($id("txt_password").value, $id("txt_repassword").value)) {
                ErrorStr.push("密码与验证密码不相同,请检查后重试!");
            }

            if (!IsEmpty($id("txt_email").value)) {
                ErrorStr.push("Email不能为空,请输入Email!");
            }
            else if (!IsEmail($id("txt_email").value)) {
                ErrorStr.push("请输入合法Email!");
            }

            if (!IsEmpty($id("txt_verify").value)) {
                ErrorStr.push("验证码不能为空,请输入验证码!");
            }

            if (ErrorStr.length != 0) {
                str = "<ul>";
                for (var i = 0; i < ErrorStr.length; i++) {
                    str = str + "<li>" + ErrorStr[i] + "</li>";
                }
                str = str + "</ul>";
                $id("strinfo").innerHTML = str;
                $id("strinfo").style.display = "block";
                ret = false;
            }
            else {
                $id("strinfo").innerHTML = "";
                $id("strinfo").style.display = "none";
            }

            return ret;
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentMain" runat="server">
    <div id="strinfo" class="mbox pbox" style="display: none;">
    </div>
    <fieldset id="Fieldset1" class="Fieldsetbox mbox pbox">
        <legend class="fsTitle">用户信息</legend>
        <table width="526" border="0" cellpadding="0" cellspacing="5">
            <tr>
                <td width="80">
                    <div align="right" class="f14">
                        用户名</div>
                </td>
                <td width="176">
                    <input type="text" class="inputbox" autocomplete="off" style="width: 150px;" id="txt_name" name="txt_name" />
                </td>
                <td width="250" class="tcgray f14">
                    用户名必须为字母、数字、下划线组合
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right" class="f14">
                        密码</div>
                </td>
                <td>
                    <input type="password" class="inputbox" style="width: 150px;" id="txt_password" name="txt_password" onKeyUp="chkpwd(this);"/>
                </td>
                <td class="tcgray f14">
                    密码必须在6位或6位以上
                </td>
            </tr>
              <tr>
                <td>
                    <div align="right" class="f14">
                        &nbsp;</div>
                </td>
                <td>
                    <div id="chkResult">密码安全检测</div>
                </td>
                <td class="tcgray f14">
                   &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right" class="f14">
                        验证密码</div>
                </td>
                <td>
                    <input type="password" class="inputbox" style="width: 150px;" id="txt_repassword" name="txt_repassword" />
                </td>
                <td class="tcgray f14">
                    与上面密码相同
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right" class="f14">
                        E-mail</div>
                </td>
                <td>
                    <input type="text" class="inputbox" autocomplete="off" style="width: 150px;" id="txt_email" name="txt_email" />
                </td>
                <td class="tcgray f14">
                    您常用的Email
                </td>
            </tr>
            <% if (isrole == "true")
               { %>
            <tr>
                <td>
                    <div align="right" class="f14">
                        用户身份</div>
                </td>
                <td>
                    <asp:DropDownList ID="RoleList" runat="server" style="width: 160px;">
                    </asp:DropDownList>
                </td>
                <td class="tcgray f14">
                    登录后的身分
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right" class="f14">
                        用户分组</div>
                </td>
                <td>
                    <asp:DropDownList ID="GroupList" runat="server" style="width: 160px;">
                    </asp:DropDownList>
                </td>
                <td class="tcgray f14">
                    所属系统分组
                </td>
            </tr>
            <%} %>
            <tr>
                <td>
                    <div align="right" class="f14">
                        验证码</div>
                </td>
                <td>
                    <input type="text" class="inputbox" autocomplete="off" style="width: 150px;" maxlength="6" id="txt_verify" name="txt_verify" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                    </div>
                </td>
                <td>
                    <img src="VerifyImage.ashx" alt="看不清,点击更换!" onclick="this.src=this.src+'?'" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <div align="right">
                    </div>
                </td>
                <td>
                    <asp:Button ID="btn_createuser" runat="server" Text="提交注册信息" Height="40px" OnClick="btn_createuser_Click"
                        Width="141px" />
                </td>
                <td>
                    &nbsp;
                </td>
            </tr>
        </table>
    </fieldset>
</asp:Content>
